package com.example.warehouse.contrallor;

import com.example.warehouse.entity.Auth;
import com.example.warehouse.entity.Result;
import com.example.warehouse.service.AutoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/auth")
@RestController
@Slf4j
public class contrallorAuth {
    @Autowired
    private AutoService autoService;

    @RequestMapping("/auth-tree")
    public Result loadAllAuthTree(){
        List<Auth> authList = autoService.allAuthTree();
        return Result.ok(authList);
    }
}
